home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u268.dms / in.adf / FRQLIB / programming.run / Programming / kd_freq.doc < prev    next >
Encoding:
Text File  |  1992-01-22  |  22.3 KB  |  834 lines

  1. kd_freq.library                            Release 3.02
  2. ---------------                            ------------
  3.                             By:  Khalid Aldoseri
  4.  
  5.  
  6.  
  7. 'kd_freq.library' is a standard Amiga shared library.  Its main function
  8. is to call up a file requester from any program so that the user can select
  9. a file.
  10.  
  11. To open the library, use OpenLibrary() like any other normal Amiga library.
  12.  
  13. The programming package contains the following files:
  14.  
  15.     kd_freq.doc    This file.
  16.     KDBase.h    C include file.
  17.     Glue.asm    C glue code for Manx/Lattice.
  18.     KDBase.i    Asm include file.
  19.     protos.h    Lattice #pragmas
  20.  
  21.  
  22. Look at test.c for the exact opening procedure.  You will need to assemble
  23. and link glue.asm along with your own object files or use the Lattice protos.
  24.  
  25.     e.g.  for Manx:
  26.  
  27.     cc +l test.c
  28.     as glue.asm
  29.     ln test.o glue.o -lc32
  30.  
  31.  
  32.  
  33.                 AutoDocs:
  34. ------------------------------------------------------------------------------
  35. kd_freq.library/NewFReq
  36.  
  37. NAME
  38.  
  39.     NewFReq - bring up a file requester and obtain a file name.
  40.  
  41. SYNOPSIS
  42.  
  43.     result = NewFReq(fr);
  44.       D0             A0
  45.  
  46.     struct FRequest *fr;
  47.     char *result;
  48.  
  49.  
  50. FUNCTION
  51.  
  52.     Accepts a pointer to a FRequest structure and calls up the file
  53.     requester.  The FRequest structure contains several arguments
  54.     that NewFReq() uses.  Specifically a default directory name,
  55.     default file name, and a default pattern (standard AmigaDOS wildcard
  56.     pattern) and returns a selected directory, selected file name, and
  57.     last pattern used in the same entries in struct FRequest that were
  58.     used to call the requester.  The CreateFRequest() call is used to
  59.     allocate and initialize the FRequest structure.
  60.  
  61.     The FRequest structure contains the following:
  62.  
  63.     struct FRequest {
  64.       struct Screen *screen;
  65.       UBYTE *reqtitle;
  66.       UBYTE *filename;
  67.       UBYTE *directory;
  68.       UBYTE *fullname;
  69.       UBYTE *pattern;
  70.       ULONG flags;
  71.       struct ExtraData *extras;
  72.       };
  73.  
  74.     fr->screen    a pointer to a Screen structure.  This defines the
  75.             screen the FR must show up on.  If NULL then it
  76.             defaults to the Workbench screen.
  77.  
  78.     fr->reqtitle    The text that will appear as the title of the FR.
  79.  
  80.     fr->filename    The default filename that will appear in the File
  81.             gadget when the FR comes up.  This will also contain
  82.             the selected filename when the call returns.
  83.  
  84.     fr->directory    The default directory that will appear in the Path
  85.             gadget when the FR comes up.  This will also contain
  86.             the selected directory when the call returns.
  87.  
  88.     fr->fullname    This is a string that is filled in by the NewFReq()
  89.             call if it is successful.  This contains the full
  90.             path to the file, i.e. directory+filename.  It is
  91.             NULL if the FR failed or was cancelled.  The NewFReq()
  92.             call returns either a pointer to this string if
  93.             successful, or NULL.
  94.  
  95.     fr->pattern    The default wildcard pattern that will appear in the
  96.             Show gadget when the FR comes up.  This will also
  97.             contain the last selected Show pattern.
  98.  
  99.     fr->flags    is a set of flags that control the operation of the FR.
  100.             These are described below.
  101.  
  102.     fr->extras    a pointer to a Struct ExtraData, as defined below.
  103.  
  104.  
  105.     File Requester Flags:
  106.     ---------------------
  107.  
  108.     FR_NOINFO    Do not show any file that ends with <.info>.
  109.             The user can change this setting later by
  110.             clicking on the 'I' gadget.
  111.             (automatically set by CreateFRequest() as FR_STDFLAGS)
  112.  
  113.     FR_NORESIZE    Do not allow the user to resize the FR.
  114.  
  115.     FR_NOTITLEBAR    Do not show the close window gadget, the drag
  116.             bar, or the front/back gadgets.  The title still
  117.             gets displayed.  This makes the FR non-movable.
  118.             This also automatically triggers FR_NORESIZE.
  119.             If you don't provide a title the file list will
  120.             resize and fill in the empty space.
  121.  
  122.     FR_AUTOPOSITION    Tells the FR to decide where it wants to come up
  123.             on its own.  (i.e. ignore LeftEdge and TopEdge)
  124.             (automatically set by CreateFRequest() as FR_STDFLAGS)
  125.  
  126.     FR_AUTOSIZE    Tells the FR to decide its size on its own.
  127.             (i.e. ignore Width and Height)
  128.             (automatically set by CreateFRequest() as FR_STDFLAGS)
  129.  
  130.     FR_OKTEXT    Tells the FR that we specified an alternate
  131.             OK text in 'extras->oktext'.
  132.  
  133.     FR_CANCELTEXT    Tells the FR that we specified an alternate
  134.             'Cancel' text in 'extras->canceltext'.
  135.  
  136.     FR_DUALWILD    When you set this flag, the wildcard pattern
  137.             you provide in 'pattern' is fixed and is applied
  138.             to all files in the FR.  The user then gets a
  139.             second wildcard in the Wildcard gadget.  (this
  140.             defauls to #?).  In essence, this allows you
  141.             to specify a pattern that will appply to ALL
  142.             the FR, no matter what the user selects as a
  143.             wildcard.  The user's wildcard is applied to
  144.             a file after it passes from the first wildcard.
  145.  
  146.     FR_FRONTSCREEN    Forces the FR to come up on the front screen.
  147.  
  148.     FR_NOTEXTSHADOW    Turns off the text shadowing in all of the FR.
  149.  
  150.     FR_NEWFONT    Tells the FR to use a different font than the
  151.             standard Topaz 8.  This can be any fixed spacing
  152.             font from 5 to 16 in size.  NO sanity checking is
  153.             done on the font size.  It is up to you to see
  154.             how the font looks like.  The FR will rescale
  155.             everything to suit the new font.  You need to
  156.             provide a pointer to a TextFont structure in
  157.             extras->NewFont.  Make sure you clear FR_SCREENFONT
  158.             if you set this.
  159.  
  160.     FR_SCREENFONT    As above, but uses the current font on the screen
  161.             the FR will show up on.  This always overrides
  162.             FR_NEWFONT.
  163.             (automatically set by CreateFRequest() as FR_STDFLAGS)
  164.  
  165.     FR_REPLACEIMAGES
  166.             Replaces the standard images in the FR with
  167.             the users's own.  The ExtraData struct below
  168.             shows where to place each pointer.  You can
  169.             use any depth of bitplanes as long as they match
  170.             the same width/height as the original gadgets.
  171.             Be creative!  Note that the size of the imagery
  172.             changes with the requested font size.
  173.  
  174.     FR_EXTENDEDSELECT Old flag.. use FR_SELECTLIST instead.
  175.  
  176.     FR_INVERTLOOK    Set this flag for an 'inverted' look for the file
  177.             list.  This is intended for use with 'save' calls
  178.             so that the user gets a visual difference between
  179.             save and load requesters.
  180.  
  181.     FR_HIDEWILD    Set this flag and point extras.Hide to a character
  182.             string of at least 32 bytes.  This should contain
  183.             the default wildcard pattern to Hide.  i.e. any
  184.             file matching this wildcard will not be shown in
  185.             the file list.
  186.             (automatically set by CreateFRequest() as FR_STDFLAGS)
  187.  
  188.     FR_NEWLOOK    If you set this flag the FR will change the
  189.             way it looks to make it match the look of
  190.             Intuition 2.0 and above.  This is automatically
  191.             set if Intuition's version number is 36 or more.
  192.             You should set this flag if you know that you
  193.             are running under 2.0 or above.  The automatic
  194.             enable might be removed in a later version.
  195.  
  196.     FR_NONEWLOOK    Disables the automatic enabling of FR_NEWLOOK.
  197.  
  198.     FR_SELECTLIST    Enable the Select List mode.  Read the section on the
  199.             Select List below.
  200.  
  201.     FR_SLSHOWNAMES    Read the section on Select List below.
  202.  
  203.     FR_KEEPBUFFERS    Enables the Keep Buffer feature.  Read section below
  204.             on 'Keep Buffers'.
  205.  
  206.     FR_EXTRABUTTONS    Allows you to define an extra gadget for the user to
  207.             click on.  You can define the gadget's text, and a
  208.             function that will be called when the gadget is
  209.             clicked on.  Read the 'ExtraButton' section below for
  210.             details on usage.
  211.  
  212.  
  213.     These flags are defined in KDBase.h.  You can OR any of these flags
  214.     together.  There are no restrictions on which flags can be or'd with
  215.     others.
  216.  
  217.     The ExtraData structure:
  218.     ------------------------
  219.  
  220.     struct ExtraData {
  221.      struct Image    *UpArrow;    /* replacement image for Up Arrow */
  222.      struct Image    *DnArrow;    /* replacement image for Down Arrow */
  223.      struct Image    *DiskNormal;    /* replacement image for Disks */
  224.      struct Image    *DiskSelected;    /* replacement select image for Disks */
  225.      struct Image    *SizeStrip;    /* private... do not use. */
  226.  
  227.      UBYTE        *oktext;    /* text to be used as OK text */
  228.      UBYTE        *canceltext;    /* text to be used as CANCEL text */
  229.      USHORT    LeftEdge,TopEdge,Width,Height;
  230.      struct TextFont *NewFont;    /* New Font to use instead of Topaz 8 */
  231.      struct FileList *ExtendedList;    /* Always set to NULL at first call.  */
  232.                     /* If FR_EXTENDEDSELECT is set, this will */
  233.                     /* return a linked list of FileList structs. */
  234.  
  235.      UBYTE *Hide;            /* Default hide wildcard */
  236.                     /* Must set FR_HIDEWILD for it to be used */
  237.                     /* Will contain a copy of the last wildcard */
  238.                     /* the user set before exiting the FR on exit */
  239.  
  240.      UBYTE *buffer;            /* private storage for temp stuff.. don't touch!!!! */
  241.      ULONG unused[4];        /* future expansion.  Always set to NULL */
  242.  
  243.      };
  244.  
  245.     You can request a specific LeftEdge, TopEdge, Width, and Height
  246.     by giving a non-zero value in any of the above arguments.  However,
  247.     it is recommended that you do not.  The requester will attempt to
  248.     come back up where it was the last time if you don't give it the
  249.     FR_AUTOSIZE and/or FR_AUTOPOSITION flags.  The default values are:
  250.  
  251.         LeftEdge    120
  252.         TopEdge         20
  253.         Width        400
  254.         Height        200
  255.  
  256.     'oktext' is the text that will be shown in the 'OK' gadget.  This
  257.     should be something like "Load" or "Save" or whatever.  The string
  258.     must not be longer than 7 characters or it will be truncated.  Make
  259.     sure that you set the FR_OKTEXT as described above.
  260.  
  261.     'canceltext' is the text that will be shown in the 'Cancel' gadget.
  262.     This should be something like "No!" or whatever.  The string
  263.     must not be longer than 7 characters or it will be truncated.  Make
  264.     sure that you set the FR_CANCELTEXT as described above.
  265.  
  266. RESULT
  267.  
  268.     pointer to fr->fullname if file selected.
  269.  
  270.     NULL if FR cancelled or failed.
  271.  
  272.     fr->directory        selected path
  273.     fr->filename        selected file
  274.     fr->fullname        full path to file (0 length if FR cancelled)
  275.  
  276.     fr->pattern        last show pattern used
  277.     fr->extras->Hide    last hide pattern used
  278.  
  279.     fr->extras->LeftEdge    /
  280.     fr->extras->TopEdge    | The FR's left edge, top edge, width and
  281.     fr->extras->Width    | height when it was closed.
  282.     fr->extras->Height    \
  283.  
  284.  
  285.  
  286. BUGS
  287.  
  288.     None.
  289.  
  290. EXAMPLE
  291.  
  292.  
  293.     #include "KDBase.h"
  294.  
  295.     struct Library *KD_FReqBase, *OpenLibrary();
  296.  
  297.     main()
  298.     {
  299.     struct FRequest *fr, *CreateFRequest();
  300.     char *file, *NewFReq();
  301.  
  302.     if (KD_FReqBase = OpenLibrary(KLIBNAME,KLIBVERSION))
  303.         {
  304.         if (fr = (struct FRequest *) CreateFRequest())
  305.             {
  306.             fr->reqtitle = (UBYTE *) "FR Test";
  307.  
  308.             if (file = (char *)NewFReq(fr))    puts(file);
  309.             else                 puts("Requester Cancelled!");
  310.  
  311.            DeleteFRequest(fr);
  312.             }
  313.  
  314.         CloseLibrary(KD_FReqBase);
  315.         }    
  316.     }
  317.  
  318.  
  319.  
  320.  
  321.                 SELECT LIST
  322.                 -----------
  323.  
  324. The FR can allow the user to select multiple files from multiple directories.
  325. To turn on this mode, you must set the FR_SELECTLIST flag in the NewFReq()
  326. call.
  327.  
  328. When the NewFReq() call returns, you can check whether or not the user
  329. selected multiple files by checking to see if fr->extras->SelectList
  330. contains a value.  If it is not NULL, then it points to a list of filenames
  331. that can be read by using the NextSelectEntry() call described below.
  332.  
  333. This returned list is yours until you free it by either calling NewFReq()
  334. again with the same FRequest structure or free the FRequest structure with
  335. DeleteFRequest().
  336.  
  337. Setting the FR_SLSHOWNAMES makes the 'Path/Name' Select List gadget default
  338. to 'Name' instead of 'Path'.  Read the user doc file, section 'Select List'
  339. for details.
  340.  
  341. The following is an example of how to use the Select List mode:
  342.  
  343. struct FRequester *fr, *CreateFRequest();
  344. UBYTE *name, *NextSelectEntry();
  345.  
  346. if (fr = (struct FRequest *) CreateFRequest())
  347.   {
  348.   fr->reqtitle    = (UBYTE *) "Multiple Select FR Test";
  349.   fr->flags    = FR_STDFLAGS | FR_SELECTLIST;
  350.  
  351.   if (NewFReq(fr))
  352.     {    
  353.     printf("File : %s\n",fr->fullname);
  354.  
  355.     if (fr->extras->SelectList)        /* Check if the user selected a */
  356.     {                /* list of files. */
  357.     printf("\nSelect List:\n\n");
  358.                     /* yes, print them out */
  359.     while (entry = NextSelectEntry(fr))
  360.         {
  361.         printf("%s\n",entry);
  362.         }
  363.     }
  364.     }
  365.  
  366.   DeleteFRequest(fr);
  367.   }
  368.  
  369.  
  370.  
  371. Notes:
  372.  
  373. - The call returns both a normal file name and a list of files.  It is up to
  374.   the calling program to clarify this point to the user.
  375.  
  376. - Check out the test.c file for the full example on how to use this facility.
  377.  
  378. - The FR_User.DOC file contains all the details on how the user can use the
  379.   Select List mode.
  380.  
  381.  
  382.                 KEEP BUFFERS
  383.                  ------------
  384.  
  385. If the FR_KEEPBUFFERS flag is set, then the FR will not clear its directory
  386. buffers and the next call to NewFReq() with the same FRequest struct will
  387. bring up the FR with all the directories intact. This includes all 5 buffers.
  388. The FR will also come up with the current buffer being the last one that was
  389. used.  This means that the FR does not have to re-read the directories again.
  390.  
  391. The DeleteFRequest() call takes care of cleaning up all the buffers associated
  392. with this feature.
  393.  
  394. This needs no work from the programmer.  Just set the FR_KEEPBUFFERS flag and
  395. it will all be handled for you.  Just make sure that you don't mind the memory
  396. that will be used to store these buffers.  Average memory requirements are
  397. around 70 files per 2k of memory.
  398.  
  399. Along with this feature, the FlushFRBuffers() call allows the programmer to
  400. selectively flush out the directory buffers without hurting anything else in
  401. the FRequest structure.
  402.  
  403.  
  404.                 EXTRA BUTTON
  405.                  ------------
  406.  
  407. The ExtraButton feature allows the calling program to define an extra button
  408. in the file requester.  This button must contain a title with a maximum of
  409. 10 characters.  You need to provide the following data in an ExtraButton
  410. structure:
  411.  
  412. struct ExtraButton {
  413.  struct ExtraButton *next;    /* pointer to next button - NULL for now */
  414.  ULONG  flags;            /* flags to define button - 0 for now */
  415.  ULONG  (*button_function)(struct ExtraButton *);
  416.                 /* function to be called when button is hit */
  417.  UBYTE  *text;            /* actual text of button, up to 10 chars */
  418.  UBYTE  *help1, *help2, *help3; /* pointers to help lines - optional */
  419.  VOID    *UserData;        /* for your use... */
  420.  struct Window *window;        /* current FR window.. read only. */
  421.  };
  422.  
  423. Your function to be called by the FR when the extrabutton is called needs
  424. to be formatted like this:
  425.  
  426.  
  427. ULONG button(eb)
  428.     struct ExtraButton *eb;
  429.     {
  430.     printf("Hey!  The user clicked on the extra button!!\n");
  431.  
  432.     printf("Button: %s\n",eb->text);
  433.     printf("Window: %08x\n",eb->window);
  434.  
  435.     return(EB_CONTINUE);
  436.     }
  437.  
  438. Note that it receives a pointer to the ExtraButton struct on the stack.  You
  439. can access all the data in the structure, but it is not safe to modify any
  440. of it, except the UserData field.
  441.  
  442. When your function returns, it must do so with a return value of one of the
  443. following:
  444.  
  445. - EB_CONTINUE        The FR just continues as if nothing happened.
  446. - EB_OK            The FR is OK'd and exists immediately
  447. - EB_CANCEL        The FR is cancelled and exists immediately
  448.  
  449.  
  450. The following is a summary of what you need to do to use this feature:
  451.  
  452. 1. Set the FR_EXTRABUTTONS flag.
  453. 2. Fill in the fr->extras->buttons with the address of your ExtraButton struct.
  454. 3. Fill in the eb.button with the address of the function to call.
  455.  
  456. The test.c file contains a full example of how to use the ExtraButton.
  457.  
  458.  
  459.  
  460. Notes:
  461.  
  462. - Make sure you set the eb.next to NULL for now.  This will hopefully support
  463.   multiple buttons in the future.  Also set the eb.flags to 0.
  464.  
  465. - The FR waits around for you while you handle the function... so be brief!
  466.  
  467. ------------------------------------------------------------------------------
  468. kd_freq.library/NextSelectEntry
  469.  
  470. NAME
  471.  
  472.     NextSelectEntry - Get next file name from FR Select List
  473.  
  474. SYNOPSIS
  475.  
  476.     result = NextSelectEntry(fr);
  477.       D0                     A0
  478.  
  479.     struct FRequest *fr;
  480.     UBYTE *result;
  481.  
  482. FUNCTION
  483.  
  484.     Returns the next entry in the Select List file that is created by
  485.     NewFReq() if the user selects multiple files.  The first time this
  486.     call is used, it returns the first file name in the Select List
  487.     or NULL if no select list exists.
  488.  
  489.     It basically returns the file name pointed to by fr->extras->NextEntry
  490.     and updates fr->extras->NextEntry to point at the next entry in the
  491.     list.
  492.  
  493. RESULT
  494.  
  495.     Pointer to a string, NULL if failed or reached end of list.
  496.  
  497. BUGS
  498.  
  499.     None.
  500.  
  501. EXAMPLE
  502.  
  503.     char *filename;
  504.  
  505.     filename = NextSelectEntry();
  506.  
  507.     The NewFReq() description above contains a full example of how to use
  508.     this function.
  509.     
  510. ------------------------------------------------------------------------------
  511. kd_freq.library/CreateFRequest
  512.  
  513. NAME
  514.  
  515.     CreateFRequest - Allocate memory for a FRequest structure.
  516.  
  517. SYNOPSIS
  518.  
  519.     fr = CreateFRequest();
  520.     D0
  521.  
  522.     struct FRequest *fr;
  523.  
  524.  
  525. FUNCTION
  526.  
  527.     Allocates a FRequest structure, an ExtraData struct, a 32 char
  528.     filename string, a 32 string pattern string, and a 128 char
  529.     directory string.  
  530.  
  531.     So, if you get a successful result, you will have the following:
  532.  
  533.     fr            pointer to an initialized FRequest structure
  534.     fr->extras        pointer to a blank ExtraData structure
  535.     fr->filename        pointer to a 32 char string
  536.     fr->directory        pointer to a 128 char string
  537.     fr->fullname        pointer to a 160 char string (read only)
  538.     fr->pattern        pointer to a 32 char string
  539.     fr->flags        contains STD_FLAGS
  540.     fr->extras->Hide    pointer to a 32 char string
  541.  
  542.     It will return a valid pointer to a FRequest only if it can
  543.     allocate all of the above, otherwise it will fail.
  544.  
  545.     It is wiser to use this call to allocate a FRequest struct at the
  546.     start of your program, and deallocate it using DeleteFRequest()
  547.     at the end of your program, allowing you to call the FR easily at
  548.     any time with a simple call.
  549.  
  550. RESULT
  551.  
  552.     Pointer to a FRequest structure, NULL if failed.
  553.  
  554. BUGS
  555.  
  556.     None.
  557.  
  558. EXAMPLE
  559.  
  560.     struct FRequest *fr;
  561.  
  562.     fr = CreateFRequest();
  563.  
  564. ------------------------------------------------------------------------------
  565. kd_freq.library/DeleteFRequest
  566.  
  567. NAME
  568.  
  569.     DeleteFRequest - Deallocate a FRequest structure that was initialized
  570.             with CreateFRequest.
  571.  
  572. SYNOPSIS
  573.  
  574.     void DeleteFRequest(fr);
  575.                         A0
  576.  
  577.     struct FRequest *fr;
  578.  
  579.  
  580. FUNCTION
  581.  
  582.     Frees all memory allocated via CreateFRequest().  It will also
  583.     checks if there is an Extended Select list attached to this
  584.     FRequest structure, and will free its memory if it exists.
  585.  
  586.  
  587. RESULT
  588.  
  589.     None.
  590.  
  591. BUGS
  592.  
  593.     None.
  594.  
  595. EXAMPLE
  596.  
  597.     struct FRequest *fr;
  598.  
  599.     DeleteFRequest(fr);
  600.  
  601.  
  602. ------------------------------------------------------------------------------
  603. kd_freq.library/FlushFRBuffers
  604.  
  605. NAME
  606.  
  607.     FlushFRBuffers - Frees cached directory buffers
  608.  
  609. SYNOPSIS
  610.  
  611.     FlushFRBuffers(fr);
  612.                    A0
  613.  
  614.     struct FRequest *fr;
  615.  
  616. FUNCTION
  617.  
  618.  
  619.     Frees all memory associated with the Keep Buffers features from a
  620.     FRequest struct without affecting any other entry in it.
  621.  
  622.  
  623. RESULT
  624.  
  625.     None.
  626.  
  627. BUGS
  628.  
  629.     None.
  630. ------------------------------------------------------------------------------
  631. kd_freq.library/NewPatMatch
  632.  
  633. NAME
  634.  
  635.     NewPatMatch - do AmigaDOS style wild card filename pattern matching.
  636.  
  637. SYNOPSIS
  638.  
  639.     result = NewPatMatch(pattern,filename);
  640.       D0                    A0       A1
  641.  
  642.     LONG  result
  643.     UBYTE *pattern;
  644.     UBYTE *filename;
  645.  
  646.  
  647. FUNCTION
  648.  
  649.     Accepts a string that is a valid AmigaDOS file name (filename) and
  650.     a valid AmigaDOS wild card pattern and tells you whether the
  651.     filename matches the pattern or not.
  652.  
  653.     Supported wildcards in pattern:
  654.  
  655.     1.  Standard AmigaDOS Wildcards:
  656.     --------------------------------
  657.  
  658.     ?    Matches any single character
  659.     #p    Match any number of occurences of the pattern p
  660.     %    Matches the null string
  661.     ()    Make a group of characters into a single pattern
  662.     |    The OR operator
  663.     '    Disable wildcard interpretation of next character
  664.         (unless it is an extended wildcard as shown below.)
  665.  
  666.     2.  Extended Wildcards:
  667.     -----------------------
  668.  
  669.     These are wildcards not supported by the standard AmigaDOS
  670.     convention, but expand it to make it more versatile.
  671.  
  672.     'd    Matches any single digit.  (0 to 9)
  673.     'a    Matches any single alpha character. (a to z)
  674.     'n    Matches any single alphanumeric character.
  675.  
  676.     For examples of standard wildcard usage, look up any AmigaDOS
  677.     tutorial book.
  678.  
  679.     Examples of extended wildcards:
  680.  
  681.     Pattern        Matching possibilities
  682.     -------        ----------------------
  683.     test'n        test0, test1, test9, testa, testA, testz, testZ
  684.     test'd        test0, test1, test9
  685.     test'a        testa, testA, testz, testZ
  686.     test 'd        test 1, test 2, test 9
  687.     test#'d        test1, test100, test10234
  688.     #'a#'d        a1, ab12, abc1, abc123, adks34234
  689.             (matches any string with some or no alpha characters,
  690.             then some or no digits.)
  691.     #'a'd#'d.c    a1.c, a203.c, 100.c, 1.c, adsdfs931234.c
  692.             (matches any string that starts with some of no alpha
  693.             characters, then at least 1 or more digits, and ends
  694.             with .c)
  695.  
  696. RESULT
  697.  
  698.     result = -1    Syntax error in wildcard pattern.
  699.     result =  0    Filename did not match pattern.
  700.     result =  1    Filename matched pattern.
  701.  
  702. BUGS
  703.  
  704.     None.
  705.  
  706.  
  707. EXAMPLE
  708.  
  709.     LONG result;
  710.  
  711.     result = NewPatMatch("#?.c","test.c");
  712.  
  713.     This will result in:  result == 1
  714.  
  715. ------------------------------------------------------------------------------
  716. kd_freq.library/NewPath
  717.  
  718. NAME
  719.  
  720.     NewPath - expand a file name to its full path.
  721.  
  722. SYNOPSIS
  723.  
  724.     New Path(filename);
  725.                 A0
  726.  
  727.     UBYTE *filename;
  728.  
  729.  
  730. FUNCTION
  731.  
  732.     Accepts a string that a valid AmigaDOS file or directory name and
  733.     expands it to the full path leading to the file/directory name.
  734.  
  735. RESULT
  736.  
  737.     filename - full path
  738.  
  739.     Note:    UBYTE *filename must be least UBYTE [128] in size.
  740.  
  741.         e.g. UBYTE filename[128];
  742.  
  743.     The string is terminated with either a / or a : depending on whether
  744.     it is a valid directory or device.
  745.  
  746.     If the filename is not a valid file name, then 'filename' is truncated
  747.     to 0 length;
  748.  
  749.  
  750. BUGS
  751.  
  752.     None.
  753.  
  754.  
  755. EXAMPLE
  756.  
  757.     UBYTE filename[128] = "dh0:";
  758.  
  759.     NewPath(filename);
  760.  
  761. ------------------------------------------------------------------------------
  762.  
  763. kd_freq.library/FReq --- OBSOLETE CALL! --- 
  764.  
  765. NAME
  766.  
  767.     FReq - bring up a file requester and obtain a file name.
  768.  
  769. SYNOPSIS
  770.  
  771.     result = FReq(screen,reqtitle,filename,directory,pattern,flags,extras);
  772.  
  773.     LONG  result
  774.     struct Screen *screen;
  775.     UBYTE *reqtitle;
  776.     UBYTE *filename;
  777.     UBYTE *directory;
  778.     UBYTE *pattern;
  779.     ULONG flags;
  780.     struct ExtraData *extras;
  781.  
  782.  
  783. FUNCTION
  784.  
  785.     --- OBSOLETE CALL! ---
  786.  
  787. RESULT
  788. ------------------------------------------------------------------------------
  789. kd_freq.library/PatMatch --- OBSOLETE CALL! ---
  790.  
  791. NAME
  792.  
  793.     PatMatch - do AmigaDOS style wild card filename pattern matching.
  794.  
  795. SYNOPSIS
  796.  
  797.     result = PatMatch(pattern,filename);
  798.  
  799.     LONG  result
  800.     UBYTE *pattern;
  801.     UBYTE *filename;
  802.  
  803. FUNCTION
  804.  
  805.     --- OBSOLETE CALL! ---
  806.  
  807. RESULT
  808. ------------------------------------------------------------------------------
  809. kd_freq.library/Path --- OBSOLETE CALL! ---
  810.  
  811. NAME
  812.  
  813.     Path - expand a file name to its full path.
  814.  
  815. SYNOPSIS
  816.  
  817.     Path(filename);
  818.  
  819.     UBYTE *filename;
  820.  
  821. FUNCTION
  822.  
  823.     --- OBSOLETE CALL! ---
  824.  
  825. RESULT
  826. ------------------------------------------------------------------------------
  827. If you have any trouble getting any call to work, don't hesitate to email me
  828. on Compuserve 75166,2531 or leave me a message in the AmigaTech forum on CIS
  829. or mail/fax me at the address at the end of the FR_User.doc file.
  830. ------------------------------------------------------------------------------
  831.             Copyright 1990,1991  Khalid Aldoseri.
  832.                     26 Nov 1991.
  833. ------------------------------------------------------------------------------
  834.